<?php

namespace app\common\model;

//use think\Model;

class ExchangeRecordModel extends BaseModel{

	protected $table = 'tp_exchange_record';

	/*
	添加记录
	 */
	public function addRecord($uid,$wid,$to_wid,$amount,$fee,$to_amount,$rate){
		$data = [
			'uid'=>$uid,
			'wid'=>$wid,
			'to_wid'=>$to_wid,
			'amount'=>$amount,
			'fee'=>$fee,
			'left_amount'=>$amount-$fee,
			'to_amount'=>$to_amount,
			'rate'=>$rate,
			'date'=>$this->getDate()
		];
		$res = $this->insertGetId($data);
		return $res;
	}
}